

define(function(require,exports,module){

	function Main(jqObj,loadParams){
	
		var columns = [[
			{field:'carId',title:'主键',hidden:true},
			{field:'carStatusName',title:'车辆状态',width:60,editor:{
				eName:'combobox',
				name:'carStatus',
				editable:false,
				panelHeight:'auto',
				data:[{value:'1',text:'正常'},{value:'0',text:'停用'},{value:'2',text:'维修'}]
			}},
			{field:'carOrgName',title:'所属部门',editor:{
				required:true,
				name:'carOrgId',
				eName:'combobox',
				editable:false,
				panelHeight:300,
				valueField: 'orgId',
				textField: 'orgShortName',
				url:'sys/fireorg/json.do',
				queryParams:{orgType1:4,pageSize:1000},
			}},
			{field:'carTypeName',title:'车辆类型',width:200,editor:{
				required:true,
				eName:'combobox',
				name:'carType',
				editable:false,
				valueField: 'codeValue',
				textField: 'codeName',
				panelHeight:'auto',
				queryParams:{codeType:3},
				url:'sys/firecode/json.do'
			}},
			{field:'carAlias',title:'车辆别名',width:300,align:"left",editor:{required:true}},
			{field:'carNum',title:'车牌号码',editor:{required:true}},
			{field:'deviceId',title:'gps设备号',editor:{}},
			{field:'carUuid',title:'关联UUID',width:220,editor:{required:true}},
			{field:'carCapacity',title:'车容量',editor:{eName:'numberbox'}},
			{field:'carManCount',title:'成员人数',editor:{eName:'numberbox'}},
			{field:'bz',title:'备注',editor:{}},
		]];
		var formDialog = {
			title:'消防车',
			width:400,
			formEx:{
				url:'fire/firecar/save.do'
			}
		}
	
		var MainUI = {
			eName:'datagrid',
			idField:'carId',
			url:'fire/firecar/json.do',
			delUrl:'fire/firecar/del.do',
			columns:columns,
			rownumbers:true,
			formDialog:formDialog,
			toolbarEx:[{
				eName:'combobox',
				width:160,
				editable:false,
				valueField: 'orgId',
				textField: 'orgShortName',
				url:'sys/fireorg/json.do',
				AllFlag:true,
				panelHeight:400,
				queryParams:{orgType1:4,pageSize:1000},
				onChange:function(newValue, oldValue){//combobox事件
					self.jqGrid.datagrid('load',{'carOrgId':newValue});
				}
			}]
		}
		jqObj.createUI(MainUI);
		self.jqGrid = jqObj.findJq('datagrid');
	}
	module.exports = Main;

});
